package org.mall.modules.product.entities;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 商品SKU
 * @Author: jeecg-boot
 * @Date:   2019-11-22
 * @Version: V1.0
 */
@Data
@TableName("product_sku")
public class CommoditySku implements Serializable {
    private static final long serialVersionUID = 1L;

    private String attrs;
    private String barcode;
    /**品牌*/
    private String brand;
    /**购物车，缩略图*/
    private String cartThumbnail;
    /**成本价*/
    private Integer costPirce;
    /**创建时间*/
    private Date createTime;
    /**是否删除（0：未删除，1：已删除）*/
    private Integer deleted;
    /**sku 编号*/
    @TableId(type = IdType.INPUT)
    private Long id;
    /**是否默认*/
    private String defaulted;
    /**itemSn*/
    private String itemSn;
    /**市场价*/
    private Integer marketPrice;
    /**图片地址*/
    private String picUrl;
    /**价格，单位：分*/
    private Integer price;
    /**库存数量*/
    private Integer quantity;
    /**商品卖点*/
    private String sellPoint;
    /**商品编号(SPU_id)*/
    private Long spuId;
    private Integer status;
    private Integer stockCount;
    /**商品标题*/
    private String title;
    /**最后更新时间1*/
    private Date updateTime;
    private Integer version;
    private Integer salesVolume;
    private Integer volumeVersion;

    public String getAttrs() {
        if (attrs==null){
            return "1";
        }
        return attrs;
    }

    public Integer getSalesVolume() {
        if (salesVolume==null){
            return 0;
        }
        return salesVolume;
    }
}
